package task

func NewTask(arg Arg) ITask {
	switch arg.RequestType {
	case "contest_info.upcoming":
		return NewUpcomingContestInfoTask()
	case "contest_info.past":
		return NewPastContestInfo()
	case "user_info":
		return NewUserInfoAndRatingTask(arg.Name)
	case "user_submission":
		return NewUserSubmissionTask(arg.Name, arg.ContestId)
	case "user_contest_history":
		return NewUserContestHistoryTask(arg.Name)
	case "contest_problems":
		return NewContestProblemTask(arg.ContestId)
	}

	return nil
}
